<?php
/**
 * Description of changepassword
 * 
 * @author anhdung
 * @since 04-07-2013 - 09:25:21
 */
?>
<div class="row-fluid">
    <div class="box span12">
        <div class="box-header">
            <h2><i class="icon-user"></i><span class="break"></span>Change Password</h2>
        </div>
        <div class="box-content">
            <?php if (Yii::app()->user->hasFlash('Success_Password')): ?>
                <div class="alert alert-success">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <strong><?php echo Yii::app()->user->getFlash('Success_Password'); ?></strong> 
                </div>
            <?php endif; ?>
            <?php if (Yii::app()->user->hasFlash('Error_Password')): ?>
                <div class="alert alert-error">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <strong><?php echo Yii::app()->user->getFlash('Error_Password'); ?></strong> 
                </div>
            <?php endif; ?>
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'id'                     => 'changepassword-form',
//                'enableAjaxValidation' => true,
                'enableClientValidation' => true,
                'htmlOptions'            => array('class' => 'form-horizontal'),
                'focus'                  => array($model, 'old_pass')
            ));
            ?>
            <fieldset>	
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'old_pass', array('class' => 'control-label')) ?>
                    <div class ="controls">
                        <?php
                        echo $form->passwordField($model, 'old_pass', array(
                            'placeholder' => $model->getAttributeLabel('old_pass'),
                            'class'       => 'input-file uniform_on'))
                        ?>
                        <font color="red"> <?php echo $form->error($model, 'old_pass'); ?> </font>
                    </div>
                </div>
                <hr>
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'new_pass', array('class' => 'control-label')) ?>
                    <div class ="controls">
                        <?php
                        echo $form->passwordField($model, 'new_pass', array(
                            'placeholder' => $model->getAttributeLabel('new_pass'),
                            'class'       => 'input-file uniform_on'))
                        ?>
                        <font color="red"> <?php echo $form->error($model, 'new_pass'); ?> </font>
                    </div>
                </div>
                <div class="control-group">
                    <?php echo $form->labelEx($model, 'renewpass', array('class' => 'control-label')) ?>
                    <div class ="controls">
                        <?php
                        echo $form->passwordField($model, 'renewpass', array(
                            'placeholder' => $model->getAttributeLabel('renewpass'),
                            'class'       => 'input-file uniform_on'))
                        ?>
                        <font color="red"> <?php echo $form->error($model, 'renewpass'); ?> </font>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="form-actions">
                    <div class="pull-left">
                        <a class="btn" href="<?php echo $this->createUrl('profile/index') ?>">
                            <i class="icon-chevron-sign-left"></i>&nbsp;Back
                        </a>
                    </div>
                    <div class="pull-right">
                        <?php echo CHtml::submitButton('Save', array('class' => 'btn btn-primary')); ?>
                        <?php echo CHtml::resetButton('Reset', array('class' => 'btn')); ?>
                    </div>
                </div>
            </fieldset>
            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>